﻿using System;
using DDDNorthWind.Core.Domain.Aggregate;
using DDDNorthWind.Core.Domain.Events;
using DDDNorthWind.Core.Domain.Identity;

namespace DDDNorthWind.Core.Domain.RepositoryInterfaces
{
    public interface IRepository<TAggregateRoot, in TIdentityKey> :IDisposable
        where TAggregateRoot : IAggregateRoot<TIdentityKey>
        where TIdentityKey : IIdentityKey
    {
        TAggregateRoot ById(TIdentityKey id);

        void Add(TAggregateRoot toAdd);

        void Update(TAggregateRoot toUpdate);
    }
}